// pages/shopCart/shopCart.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    shopObj: {},
    shopList: []

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    var id = wx.getStorageSync("_id")
    // console.log(id);
    this.getShopsList(id)
    // this.getData(this.getShopsList(id))
  },
  onShow() {
    console.log(wx.getStorage('arr'));
  },
  // 获取加入购物车的数据
  getShopsList(_id) {
    wx.request({
      url: 'https://api.it120.cc/noodles/shop/goods/detail?id=' + _id,
      method: "GET",
      data: {},
      success: (res) => {
        // this.setData({
        //   shopObj: res.data.data.basicInfo,
        // })
        wx.setStorageSync('arr', res.data.data.basicInfo)
      }
    })
  },
  // 获取全部数据
  getData(e) {
    // console.log(e);
  }
})